package org.example2;

/**
 *  验证方法体有覆盖,也算是真正的继承
 */
public class AppAnonymousExtends {
    public static void main(String[] args) {

        MyClass myClass1 = new MyClass();
        MyClass myClass2= new MyClass() {

        };

        System.out.println("myClass1的类:"+myClass1.getClass().getName());
        System.out.println("myClass2的类:"+myClass2.getClass().getName());
        System.out.println("myClass2的父类:"+myClass2.getClass().getSuperclass().getName());
        System.out.println("myClass2的getPackage:"+myClass2.getClass().getPackage());

        System.out.println("-----------------------------------------------------");

        MyInterface myInterface = new MyInterface() {

        };

        System.out.println("myInterface的类:"+myInterface.getClass().getName());



    }
}
